import request from '@/utils/request'

export function getDistrictList(query) {
  return request({
    url: '/geography/district/getList',
    method: 'post',
    data: query
  })
}

export function getDistrictUseableList(query) {
  if(query != undefined){
    query = JSON.parse(JSON.stringify(query))
  }
  return request({
    url: '/geography/district/getAvailable',
    method: 'post',
    data: query
  })
}
export function getDistrictDetail(id) {
  return request({
    url: '/geography/district/getDetail',
    method: 'post',
    data: id 
  })
}

export function removeDistrictByID(districtID) {
  return request({
    url: '/geography/district/delete',
    method: 'post',
    data: {
      'districtID': districtID
    }
  })
}

export function saveDistrict(data) {
  return request({
    url: '/geography/district/save',
    method: 'post',
    data
  })
}

export function importDistrict(data){
  return request({
    url: '/geography/district/import',
    method: 'post',
    data: data
  })
}